<template>
  <div>
    <h1>Child2</h1>
    <button @click='$root.$emit("getCount",2)'>点击</button>
  </div>
</template>

<script>
export default {
  name: "Child2",
  mounted() {
    console.log(this.$root)
  },
};
</script>

<style>
</style>